Skip to content

OCPBUGS-69755:CNTRLPLANE-2158:Migrating TestTokenRequestAndReview to ginkgo#1978

Merged
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
gangwgr:ote-migration-sa-test
Dec 18, 2025
Merged

OCPBUGS-69755:CNTRLPLANE-2158:Migrating TestTokenRequestAndReview to ginkgo#1978
openshift-merge-bot[bot] merged 2 commits intoopenshift:mainfrom
gangwgr:ote-migration-sa-test

Conversation

@gangwgr
Copy link
Copy Markdown
Contributor

@gangwgr gangwgr commented Nov 28, 2025

Migrate TestTokenRequestAndReview to dual-compatible test framework

This commit migrates the TestTokenRequestAndReview test to support both
Ginkgo (OTE framework) and standard Go test execution using a
dual-compatibility approach.

Changes:

  • Created test/e2e/bound_sa_token.go with:

    • TestingT interface: minimal common interface that both testing.TB
      and ginkgo.GinkgoTInterface implement
    • testTokenRequestAndReview(t TestingT): shared test implementation
    • Ginkgo wrapper that calls testTokenRequestAndReview(g.GinkgoT())
  • Updated test/e2e/bound_sa_token_test.go:

    • Added TestTokenRequestAndReview(t *testing.T) that calls the
      shared testTokenRequestAndReview(t) function
  • Replaced Gomega assertions (o.Expect) with require package assertions
    (require.NoError, require.Empty, require.True) which work with the
    minimal TestingT interface

Benefits:

  • Single test implementation maintains consistency between frameworks
  • Can run via standard Go: go test -run TestTokenRequestAndReview
  • Can run via Ginkgo/OTE: ./...-tests-ext run-test "..."
  • No code duplication between test frameworks
  • Uses require for assertions which only needs Errorf, FailNow, and
    Helper methods (compatible with both testing.TB and GinkgoTInterface)
    Test run - 
    /cluster-kube-apiserver-operator-tests-ext run-suite openshift/cluster-kube-apiserver-operator/operator/serial -c 1
  Running Suite:  - /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator
  ========================================================================================
  Random Seed: 1764327116 - will randomize all specs

  Will run 1 of 1 specs
  ------------------------------
  [sig-api-machinery] kube-apiserver operator [Operator][Serial] TestTokenRequestAndReview
  github.com/openshift/cluster-kube-apiserver-operator/test/e2e/bound_sa_token.go:27
Found configuration for host https://xxxxx.
  • [3.707 seconds]
  ------------------------------

  Ran 1 of 1 Specs in 3.708 seconds
  SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
  {
    "name": "[sig-api-machinery] kube-apiserver operator [Operator][Serial] TestTokenRequestAndReview",
    "lifecycle": "blocking",
    "duration": 3707,
    "startTime": "2025-11-28 10:51:56.871582 UTC",
    "endTime": "2025-11-28 10:52:00.579330 UTC",
    "result": "passed",
    "output": ""
  }
]%                                                                                                                                                                                                                               rgangwar@rgangwar-mac cluster-kube-apiserver-operator % go test -v -mod=vendor ./test/e2e -run TestTokenRequestAndReview                                                    
=== RUN   TestTokenRequestAndReview
Found configuration for host https://xxxxxx.
--- PASS: TestTokenRequestAndReview (3.68s)
PASS
ok  	github.com/openshift/cluster-kube-apiserver-operator/test/e2e	4.441s
    
    

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 28, 2025

Walkthrough

Adds a blank-import in the test-extension main to register Ginkgo tests, introduces a new Ginkgo E2E test that extracts shared token-request-and-review logic, refactors the existing Go test to call the shared function, and updates go.mod to require Ginkgo v2.21.0.

Changes

Cohort / File(s) Summary
Test extension registration
cmd/cluster-kube-apiserver-operator-tests-ext/main.go
Adds a blank (side-effect) import _ "github.com/openshift/cluster-kube-apiserver-operator/test/e2e" to register E2E/Ginkgo tests with the test extension framework.
New Ginkgo E2E test + shared logic
test/e2e/bound_sa_token.go
New file: introduces a Ginkgo-based test ([Operator][Serial] TestTokenRequestAndReview) and a shared, reusable testTokenRequestAndReview function that creates a temporary namespace and service account, requests a bound token, and performs a TokenReview.
Unit test refactor to use shared logic
test/e2e/bound_sa_token_test.go
Replaces inline test setup and assertions with a delegation to testTokenRequestAndReview(t); removes now-unused imports and duplicated setup code.
Dependency update
go.mod
Adds github.com/onsi/ginkgo/v2 v2.21.0 to module requirements and removes a duplicate/indirect entry.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect test/e2e/bound_sa_token.go for correct Kubernetes client creation, namespace/service-account cleanup, and TokenRequest/TokenReview construction and assertions.
  • Verify the blank import in cmd/.../main.go properly registers the Ginkgo tests with the intended test runner.
  • Confirm go.mod placement of the Ginkgo requirement and run go mod tidy in the branch to detect any dependency issues.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between dfefc0d and 49c18f5.

📒 Files selected for processing (4)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go (1 hunks)
  • go.mod (1 hunks)
  • test/e2e/bound_sa_token.go (1 hunks)
  • test/e2e/bound_sa_token_test.go (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
  • test/e2e/bound_sa_token.go
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • test/e2e/bound_sa_token_test.go
  • go.mod

Comment @coderabbitai help to get the list of available commands and usage tips.

@gangwgr gangwgr changed the title Migrating TestTokenRequestAndReview to ginkgo [WIP]Migrating TestTokenRequestAndReview to ginkgo Nov 28, 2025
@openshift-ci openshift-ci Bot requested review from deads2k and p0lyn0mial November 28, 2025 10:53
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 28, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between eecc8a9 and 2b98057.

📒 Files selected for processing (3)
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go (1 hunks)
  • test/e2e/bound_sa_token.go (1 hunks)
  • test/e2e/bound_sa_token_test.go (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • test/e2e/bound_sa_token_test.go
  • test/e2e/bound_sa_token.go
  • cmd/cluster-kube-apiserver-operator-tests-ext/main.go
🧬 Code graph analysis (1)
test/e2e/bound_sa_token.go (1)
test/library/client.go (1)
  • NewClientConfigForTest (12-20)
🔇 Additional comments (5)
cmd/cluster-kube-apiserver-operator-tests-ext/main.go (1)

22-23: LGTM!

The blank import with explanatory comment correctly registers the E2E tests with the test extension framework via side-effect initialization.

test/e2e/bound_sa_token.go (3)

17-24: LGTM!

The TestingT interface correctly captures the minimal common interface between testing.TB and ginkgo.GinkgoTInterface, enabling code reuse across both test frameworks.


26-30: LGTM!

The Ginkgo test registration with [Operator][Serial] tags correctly matches the suite qualifier defined in the test extension registry.


57-83: LGTM!

The test logic correctly exercises the TokenRequest and TokenReview APIs with appropriate assertions. The service account creation, token request with default audience, and authentication validation are all properly implemented.

test/e2e/bound_sa_token_test.go (1)

169-177: LGTM!

Clean delegation to the shared testTokenRequestAndReview function with a clear comment explaining the dual-use pattern. The *testing.T type satisfies the TestingT interface, enabling seamless reuse.

Comment thread test/e2e/bound_sa_token.go
@gangwgr gangwgr changed the title [WIP]Migrating TestTokenRequestAndReview to ginkgo [WIP]CNTRLPLANE-2072:Migrating TestTokenRequestAndReview to ginkgo Nov 28, 2025
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 28, 2025
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Nov 28, 2025

@gangwgr: This pull request references CNTRLPLANE-2072 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Migrate TestTokenRequestAndReview to dual-compatible test framework

This commit migrates the TestTokenRequestAndReview test to support both
Ginkgo (OTE framework) and standard Go test execution using a
dual-compatibility approach.

Changes:

  • Created test/e2e/bound_sa_token.go with:

    • TestingT interface: minimal common interface that both testing.TB
      and ginkgo.GinkgoTInterface implement
    • testTokenRequestAndReview(t TestingT): shared test implementation
    • Ginkgo wrapper that calls testTokenRequestAndReview(g.GinkgoT())
  • Updated test/e2e/bound_sa_token_test.go:

    • Added TestTokenRequestAndReview(t *testing.T) that calls the
      shared testTokenRequestAndReview(t) function
  • Replaced Gomega assertions (o.Expect) with require package assertions
    (require.NoError, require.Empty, require.True) which work with the
    minimal TestingT interface

Benefits:

  • Single test implementation maintains consistency between frameworks
  • Can run via standard Go: go test -run TestTokenRequestAndReview
  • Can run via Ginkgo/OTE: ./...-tests-ext run-test "..."
  • No code duplication between test frameworks
  • Uses require for assertions which only needs Errorf, FailNow, and
    Helper methods (compatible with both testing.TB and GinkgoTInterface)
   Test run - 
   /cluster-kube-apiserver-operator-tests-ext run-suite openshift/cluster-kube-apiserver-operator/operator/serial -c 1
 Running Suite:  - /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator
 ========================================================================================
 Random Seed: 1764327116 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-api-machinery] kube-apiserver operator [Operator][Serial] TestTokenRequestAndReview
 github.com/openshift/cluster-kube-apiserver-operator/test/e2e/bound_sa_token.go:27
Found configuration for host https://xxxxx.
 • [3.707 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 3.708 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
 {
   "name": "[sig-api-machinery] kube-apiserver operator [Operator][Serial] TestTokenRequestAndReview",
   "lifecycle": "blocking",
   "duration": 3707,
   "startTime": "2025-11-28 10:51:56.871582 UTC",
   "endTime": "2025-11-28 10:52:00.579330 UTC",
   "result": "passed",
   "output": ""
 }
]%                                                                                                                                                                                                                               rgangwar@rgangwar-mac cluster-kube-apiserver-operator % go test -v -mod=vendor ./test/e2e -run TestTokenRequestAndReview                                                    
=== RUN   TestTokenRequestAndReview
Found configuration for host https://xxxxxx.
--- PASS: TestTokenRequestAndReview (3.68s)
PASS
ok  	github.com/openshift/cluster-kube-apiserver-operator/test/e2e	4.441s
   
   

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@gangwgr gangwgr changed the title [WIP]CNTRLPLANE-2072:Migrating TestTokenRequestAndReview to ginkgo CNTRLPLANE-2072:Migrating TestTokenRequestAndReview to ginkgo Dec 1, 2025
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 1, 2025
@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 1, 2025

/assign @p0lyn0mial

Copy link
Copy Markdown
Contributor

@p0lyn0mial p0lyn0mial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we run optional e2e-gcp-operator-serial-ote job on this PR?

Comment thread go.mod Outdated
sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96
)

require github.com/onsi/ginkgo/v2 v2.21.0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could it be moved to the require section above ?

Comment thread test/e2e/bound_sa_token.go Outdated
// TestingT is the minimal common interface that both testing.TB and
// ginkgo.GinkgoTInterface implement. This allows test functions to be
// called from both standard Go tests and Ginkgo tests.
type TestingT interface {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove this interface and use testing.TB instead.

Comment thread test/e2e/bound_sa_token.go Outdated
// testTokenRequestAndReview checks that bound sa tokens are correctly
// configured. A token is requested via the TokenRequest API and
// validated via the TokenReview API.
func testTokenRequestAndReview(t TestingT) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use t testing.TB

Comment thread test/e2e/bound_sa_token.go Outdated

var _ = g.Describe("[sig-api-machinery] kube-apiserver operator", func() {
g.It("[Operator][Serial] TestTokenRequestAndReview", func() {
testTokenRequestAndReview(g.GinkgoT())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ginkgoTB()

Comment thread test/e2e/bound_sa_token_test.go
@p0lyn0mial
Copy link
Copy Markdown
Contributor

lgtm, let’s squash the first and third commits.

This commit migrates the TestTokenRequestAndReview test to use the Ginkgo
framework while maintaining backward compatibility with standard Go tests.

Key changes:
- Created test/e2e/bound_sa_token.go with Ginkgo test definition
- Implemented testTokenRequestAndReview() function accepting testing.TB
- Uses g.GinkgoTB() for full testing.TB compatibility
- Added TestTokenRequestAndReview wrapper in bound_sa_token_test.go
- Imported test package in main.go to register Ginkgo tests

This dual-compatibility approach is temporary until the new
e2e-gcp-operator-serial-ote job is fully tested. Eventually all tests
will run only as part of the OTE framework.
Per code review feedback, moved github.com/onsi/ginkgo/v2 from the
indirect dependencies section to the main require block since it's
now a direct dependency used by the test code.
@gangwgr gangwgr force-pushed the ote-migration-sa-test branch from dfefc0d to 49c18f5 Compare December 3, 2025 08:28
@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 3, 2025

lgtm, let’s squash the first and third commits.

updated

@p0lyn0mial
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2025
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Dec 3, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gangwgr, p0lyn0mial

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2025
@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 3, 2025

/verified by ci runs

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Dec 3, 2025
@openshift-ci-robot
Copy link
Copy Markdown

@gangwgr: This PR has been marked as verified by ci runs.

Details

In response to this:

/verified by ci runs

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 3, 2025

/test

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 3, 2025

/test e2e-aws-ovn-serial-1of2

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Dec 3, 2025

@gangwgr: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

/test e2e-aws-ovn
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-aws-ovn-upgrade
/test e2e-gcp-operator
/test images
/test k8s-e2e-gcp
/test okd-scos-images
/test unit
/test verify
/test verify-deps

The following commands are available to trigger optional jobs:

/test e2e-aws-operator-disruptive-single-node
/test e2e-aws-ovn-single-node
/test e2e-azure-ovn
/test e2e-gcp-operator-encryption-aescbc
/test e2e-gcp-operator-encryption-aesgcm
/test e2e-gcp-operator-encryption-perf-aescbc
/test e2e-gcp-operator-encryption-perf-aesgcm
/test e2e-gcp-operator-encryption-perf-single-node
/test e2e-gcp-operator-encryption-rotation-aescbc
/test e2e-gcp-operator-encryption-rotation-aesgcm
/test e2e-gcp-operator-encryption-rotation-single-node
/test e2e-gcp-operator-encryption-single-node
/test e2e-gcp-operator-serial-ote
/test e2e-gcp-operator-single-node
/test e2e-metal-ovn-ha-cert-rotation-shutdown-180d
/test e2e-metal-ovn-ha-cert-rotation-shutdown-1y
/test e2e-metal-ovn-ha-cert-rotation-shutdown-90d
/test e2e-metal-ovn-ha-cert-rotation-suspend-180d
/test e2e-metal-ovn-ha-cert-rotation-suspend-1y
/test e2e-metal-ovn-ha-cert-rotation-suspend-90d
/test e2e-metal-ovn-sno-cert-rotation-shutdown-180d
/test e2e-metal-ovn-sno-cert-rotation-shutdown-1y
/test e2e-metal-ovn-sno-cert-rotation-shutdown-90d
/test e2e-metal-ovn-sno-cert-rotation-suspend-180d
/test e2e-metal-ovn-sno-cert-rotation-suspend-1y
/test e2e-metal-ovn-sno-cert-rotation-suspend-2y
/test e2e-metal-ovn-sno-cert-rotation-suspend-3y
/test e2e-metal-ovn-sno-cert-rotation-suspend-90d
/test e2e-metal-single-node-live-iso
/test e2e-short-cert-rotation
/test e2e-short-cert-rotation-azure
/test k8s-e2e-gcp-serial
/test okd-scos-e2e-aws-ovn

Use /test all to run the following jobs that were automatically triggered:

pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-aws-ovn
pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-aws-ovn-serial-1of2
pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-aws-ovn-serial-2of2
pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-aws-ovn-upgrade
pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-gcp-operator
pull-ci-openshift-cluster-kube-apiserver-operator-main-e2e-gcp-operator-serial-ote
pull-ci-openshift-cluster-kube-apiserver-operator-main-images
pull-ci-openshift-cluster-kube-apiserver-operator-main-k8s-e2e-gcp
pull-ci-openshift-cluster-kube-apiserver-operator-main-okd-scos-images
pull-ci-openshift-cluster-kube-apiserver-operator-main-unit
pull-ci-openshift-cluster-kube-apiserver-operator-main-verify
pull-ci-openshift-cluster-kube-apiserver-operator-main-verify-deps
Details

In response to this:

/test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 3, 2025

/test e2e-aws-ovn-serial-2of2

@wangke19
Copy link
Copy Markdown
Contributor

wangke19 commented Dec 3, 2025

/retitle CNTRLPLANE-2158:Migrating TestTokenRequestAndReview to ginkgo

@openshift-ci openshift-ci Bot changed the title CNTRLPLANE-2072:Migrating TestTokenRequestAndReview to ginkgo CNTRLPLANE-2158:Migrating TestTokenRequestAndReview to ginkgo Dec 3, 2025
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Dec 3, 2025

@gangwgr: This pull request references CNTRLPLANE-2158 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Migrate TestTokenRequestAndReview to dual-compatible test framework

This commit migrates the TestTokenRequestAndReview test to support both
Ginkgo (OTE framework) and standard Go test execution using a
dual-compatibility approach.

Changes:

  • Created test/e2e/bound_sa_token.go with:

    • TestingT interface: minimal common interface that both testing.TB
      and ginkgo.GinkgoTInterface implement
    • testTokenRequestAndReview(t TestingT): shared test implementation
    • Ginkgo wrapper that calls testTokenRequestAndReview(g.GinkgoT())
  • Updated test/e2e/bound_sa_token_test.go:

    • Added TestTokenRequestAndReview(t *testing.T) that calls the
      shared testTokenRequestAndReview(t) function
  • Replaced Gomega assertions (o.Expect) with require package assertions
    (require.NoError, require.Empty, require.True) which work with the
    minimal TestingT interface

Benefits:

  • Single test implementation maintains consistency between frameworks
  • Can run via standard Go: go test -run TestTokenRequestAndReview
  • Can run via Ginkgo/OTE: ./...-tests-ext run-test "..."
  • No code duplication between test frameworks
  • Uses require for assertions which only needs Errorf, FailNow, and
    Helper methods (compatible with both testing.TB and GinkgoTInterface)
   Test run - 
   /cluster-kube-apiserver-operator-tests-ext run-suite openshift/cluster-kube-apiserver-operator/operator/serial -c 1
 Running Suite:  - /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator
 ========================================================================================
 Random Seed: 1764327116 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-api-machinery] kube-apiserver operator [Operator][Serial] TestTokenRequestAndReview
 github.com/openshift/cluster-kube-apiserver-operator/test/e2e/bound_sa_token.go:27
Found configuration for host https://xxxxx.
 • [3.707 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 3.708 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
 {
   "name": "[sig-api-machinery] kube-apiserver operator [Operator][Serial] TestTokenRequestAndReview",
   "lifecycle": "blocking",
   "duration": 3707,
   "startTime": "2025-11-28 10:51:56.871582 UTC",
   "endTime": "2025-11-28 10:52:00.579330 UTC",
   "result": "passed",
   "output": ""
 }
]%                                                                                                                                                                                                                               rgangwar@rgangwar-mac cluster-kube-apiserver-operator % go test -v -mod=vendor ./test/e2e -run TestTokenRequestAndReview                                                    
=== RUN   TestTokenRequestAndReview
Found configuration for host https://xxxxxx.
--- PASS: TestTokenRequestAndReview (3.68s)
PASS
ok  	github.com/openshift/cluster-kube-apiserver-operator/test/e2e	4.441s
   
   

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 3, 2025

/test e2e-aws-ovn-serial-1of2

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 3, 2025

/test e2e-aws-ovn-serial-2of2

@wangke19
Copy link
Copy Markdown
Contributor

wangke19 commented Dec 3, 2025

/retest-required

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 11, 2025

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci Bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Dec 11, 2025
@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 11, 2025

/test e2e-aws-ovn-serial-2of2

@p0lyn0mial
Copy link
Copy Markdown
Contributor

@gangwgr this PR isn't fixing anything critical, please remove the label. (unless i am missing something).

the master branch is quite unstable and adding non critical changes is not desirable at the moment.

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 2c58d2f and 2 for PR HEAD 49c18f5 in total

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 11, 2025

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 11, 2025
@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 11, 2025

/remove-label acknowledge-critical-fixes-only

@openshift-ci openshift-ci Bot removed the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Dec 11, 2025
@p0lyn0mial
Copy link
Copy Markdown
Contributor

@gangwgr you can also remove the hold label. once the requirement for acknowledge-critical-fixes-only will be removed the pr will merge automatically

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 12, 2025

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 12, 2025
Copy link
Copy Markdown
Contributor

@p0lyn0mial p0lyn0mial left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add a todo and a link to a jira issue (migration) for https://github.com/openshift/cluster-kube-apiserver-operator/blob/main/test/e2e/bound_sa_token_test.go#L35

sorry, i wanted to post that comment on #1983

you can ignore it.

@openshift-ci-robot
Copy link
Copy Markdown

/retest-required

Remaining retests: 0 against base HEAD 33061a0 and 1 for PR HEAD 49c18f5 in total

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 18, 2025

/retest-required

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Dec 18, 2025

@gangwgr: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit 56ec93c into openshift:main Dec 18, 2025
14 checks passed
@gangwgr gangwgr changed the title CNTRLPLANE-2158:Migrating TestTokenRequestAndReview to ginkgo OCPBUGS-69755:CNTRLPLANE-2158:Migrating TestTokenRequestAndReview to ginkgo Dec 18, 2025
@openshift-ci-robot
Copy link
Copy Markdown

@gangwgr: Jira Issue Verification Checks: Jira Issue OCPBUGS-69755
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-69755 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

Migrate TestTokenRequestAndReview to dual-compatible test framework

This commit migrates the TestTokenRequestAndReview test to support both
Ginkgo (OTE framework) and standard Go test execution using a
dual-compatibility approach.

Changes:

  • Created test/e2e/bound_sa_token.go with:

    • TestingT interface: minimal common interface that both testing.TB
      and ginkgo.GinkgoTInterface implement
    • testTokenRequestAndReview(t TestingT): shared test implementation
    • Ginkgo wrapper that calls testTokenRequestAndReview(g.GinkgoT())
  • Updated test/e2e/bound_sa_token_test.go:

    • Added TestTokenRequestAndReview(t *testing.T) that calls the
      shared testTokenRequestAndReview(t) function
  • Replaced Gomega assertions (o.Expect) with require package assertions
    (require.NoError, require.Empty, require.True) which work with the
    minimal TestingT interface

Benefits:

  • Single test implementation maintains consistency between frameworks
  • Can run via standard Go: go test -run TestTokenRequestAndReview
  • Can run via Ginkgo/OTE: ./...-tests-ext run-test "..."
  • No code duplication between test frameworks
  • Uses require for assertions which only needs Errorf, FailNow, and
    Helper methods (compatible with both testing.TB and GinkgoTInterface)
   Test run - 
   /cluster-kube-apiserver-operator-tests-ext run-suite openshift/cluster-kube-apiserver-operator/operator/serial -c 1
 Running Suite:  - /Users/rgangwar/Downloads/backupoffice/cluster-kube-apiserver-operator
 ========================================================================================
 Random Seed: 1764327116 - will randomize all specs

 Will run 1 of 1 specs
 ------------------------------
 [sig-api-machinery] kube-apiserver operator [Operator][Serial] TestTokenRequestAndReview
 github.com/openshift/cluster-kube-apiserver-operator/test/e2e/bound_sa_token.go:27
Found configuration for host https://xxxxx.
 • [3.707 seconds]
 ------------------------------

 Ran 1 of 1 Specs in 3.708 seconds
 SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 0 Skipped
[
 {
   "name": "[sig-api-machinery] kube-apiserver operator [Operator][Serial] TestTokenRequestAndReview",
   "lifecycle": "blocking",
   "duration": 3707,
   "startTime": "2025-11-28 10:51:56.871582 UTC",
   "endTime": "2025-11-28 10:52:00.579330 UTC",
   "result": "passed",
   "output": ""
 }
]%                                                                                                                                                                                                                               rgangwar@rgangwar-mac cluster-kube-apiserver-operator % go test -v -mod=vendor ./test/e2e -run TestTokenRequestAndReview                                                    
=== RUN   TestTokenRequestAndReview
Found configuration for host https://xxxxxx.
--- PASS: TestTokenRequestAndReview (3.68s)
PASS
ok  	github.com/openshift/cluster-kube-apiserver-operator/test/e2e	4.441s
   
   

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@gangwgr
Copy link
Copy Markdown
Contributor Author

gangwgr commented Dec 18, 2025

/cherry-pick release-4.21

@openshift-cherrypick-robot
Copy link
Copy Markdown

@gangwgr: new pull request created: #1987

Details

In response to this:

/cherry-pick release-4.21

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants